<!DOCTYPE html>
            
<HTML>
<HEAD>
<meta name="booktitle" content="Developing Applications With Objective Caml" >
 <meta charset="ISO-8859-1"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<META name="GENERATOR" content="hevea 1.05-7 of 2000-02-24">
<META NAME="Author" CONTENT="Christian.Queinnec@lip6.fr">
<LINK rel=stylesheet type="text/css" href="videoc-ocda.css">
<script language="JavaScript" src="videoc.js"><!--
//--></script>
<TITLE>
 To learn more
</TITLE>
</HEAD>
<BODY class="regularBody">
<A HREF="book-ora053.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="book-ora056.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2> To learn more</H2>
Although graphics programming is naturally event-driven, the
associated style of programming being imperative, it is not only
possible but also often useful to introduce more functional operators
to manipulate graphical objects. A good example comes from the use of
the <TT>MLgraph</TT> library,


<H3> Link </H3> <HR>

<A HREF="http://www.pps.jussieu.fr/~cousinea/MLgraph/mlgraph.html">http://www.pps.jussieu.fr/~cousinea/MLgraph/mlgraph.html</A>


<HR>


which implements the graphical model of PostScript and proposes functional
operators to manipulate images. It is described in [<A HREF="book-ora214.html#ChaCou92"><CITE>CC92</CITE></A><CITE>, </CITE><A HREF="book-ora214.html#ChaSua94"><CITE>CS94</CITE></A>]
and used later in [<A HREF="book-ora214.html#Cousineau-Mauny"><CITE>CM98</CITE></A>] for the optimized placement
of trees to construct drawings in the style of Escher.<BR>
<BR>
One interesting characteristic of the <TT>Graphics</TT> library is that
it is portable to the graphical interfaces of Windows, MacOS
and Unix. The notion of virtual bitmaps can be found in several
languages like Le_Lisp and more recently in Java. Unfortunately,
the <TT>Graphics</TT> library in Objective CAML does not possess interactive
components for the construction of interfaces. One of the applications
described in part II of this book contains the first bricks of the
<TT>Awi</TT> library. It is inspired by the Abstract Windowing
Toolkit of the first versions of Java. One can perceive that it is
relatively easy to extend the functionality of this library thanks to
the existence of functional values in the language. Therefore chapter
<A HREF="index.html#chap-C-Organisation">16</A> compares the adaptation of object oriented
programming and functional and modular programming for the construction
of graphical interfaces. The example of <TT>Awi</TT> is functional and
imperative, but it is also possible to only use the functional style. This
is typically the case for purely functional languages. We cite the systems
<TT>Fran</TT> and <TT>Fudget</TT> developed in Haskell and derivatives. The
system <TT>Fran</TT> permits construction of interactive animations in 2D
and 3D, which means with events between animated objects and the user.<BR>
<BR>


<H3> Link </H3> <HR>

<A HREF="http://www.research.microsoft.com/~conal/fran/">http://www.research.microsoft.com/~conal/fran/</A>


<HR>


The <TT>Fudget</TT> library is intended for the construction of graphical
interfaces.


<H3> Link </H3> <HR>

<A HREF="http://www.cs.chalmers.se/ComputingScience/Research/Functional/Fudgets/">http://www.cs.chalmers.se/ComputingScience/Research/Functional/Fudgets/</A>


<HR>

<BR>
<BR>
One of the difficulties when one wants to program a graphical interface
for ones application is to know which of the numerous existing libraries
to choose. It is not sufficient to determine the language and the system
to fix the choice of the tool. For Objective CAML there exist several more or
less complete ones:
<UL>
<LI>
 the encapsulation of <TT>libX</TT>, for X-Windows;

<LI> the <TT>librt</TT> library, also for X-Windows;

<LI> <TT>ocamltk</TT>, an adaptation of <TT>Tcl/Tk</TT>, portable;

<LI> <TT>mlgtk</TT>, an adaptation of <TT>Gtk</TT>, portable.
</UL>We find the links to these developments in the ``Caml Hump'':


<H3> Link </H3> <HR>

<A HREF="http://caml.inria.fr/hump.html">http://caml.inria.fr/hump.html</A>


<HR>

<BR>
<BR>
Finally, we have only discussed programming in 2D. The tendency is
to add one dimension. Functional languages must also respond to this
necessity, perhaps in the model of VRML or the Java 3D-extension. In
purely functional languages the system <TT>Fran</TT> offers interesting
possibilities of interaction between sprites. More closely to
Objective CAML one can use the <TT>VRcaML</TT> library or the development
environment SCOL.<BR>
<BR>
The <TT>VRcaML</TT> library was developed in the manner of
<TT>MLgraph</TT> and integrates a part of the graphical model of
VRML in Objective CAML.


<H3> Link </H3> <HR>

<A HREF="http://www.pps.jussieu.fr/~emmanuel/Public/enseignement/VRcaML">http://www.pps.jussieu.fr/~emmanuel/Public/enseignement/VRcaML</A>


<HR>


One can therefore construct animated scenes in 3D. The result is a
VRML-file that can be directly visualized.<BR>
<BR>
Still in the line of Caml, the language SCOL is a functional
communication language with important libraries for 2D and 3D
manipulations, which is intended as environment for people with little
knowledge in computer science.


<H3> Link </H3> <HR>

<A HREF="http://www.cryo-networks.com">http://www.cryo-networks.com</A>


<HR>


The interest in the language SCOL and its development environment is
to be able to create distributed applications, e.g. client-server, thus
facilitating the creation of Internet sites. We present distributed
programming in Objective CAML in chapter <A HREF="index.html#chap-PD">20</A>.

<BR>
<BR>

<BR>
<BR>
<BR>
<BR>
<HR>
<A HREF="book-ora053.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="book-ora056.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
